<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var apple = 0; //苹果
        var pear = 0; //梨
        var peach = 0; //桃子

        for (apple = 0; apple <= 50; apple++) {
            for (pear = 0; pear <= (100 - apple); pear++) {
                peach = 100 - apple - pear;

                if (3 * apple + 2 * pear + peach == 200) {
                    console.log(apple, pear, peach);
                }
            }
        }
    </script>
</body>

</html>